﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Galaxian
{
    public class Ship : GameObject, IMovable, IShootable
    {
        //I need to re-think what to put in a Ship and how
        private int killCount = 0;
        private int pointsForKill = 0;

        public int PointsForKill
        {
            get { return pointsForKill; }
            set { pointsForKill = value; }
        }

        public int KillCount
        {
            get { return this.killCount; }
            set { this.killCount = value; }
        }

        //that's from me (gardax)
        public Ship(Position pos)
            : base(pos, Objects.Ship)
        {
        }

        public override bool CanCollideWith(Objects obj)
        {
            return obj == Objects.Enemy || obj == Objects.Projectile;
        }

        public void Shoot(Projectile proj)
        {
            proj.AutoMove();
        }

        public override char[,] GetImage()
        {
            return new char[,] { { 'A' } };
        }

        public void MoveLeft()
        {
            if (this.Position.Y != 0)
            {
                this.Position.Y--;
            }
        }

        public void MoveRight()
        {
            if (this.Position.Y != Field.Width - 1)
            {
                this.Position.Y++;
            }
        }

        public override Position GetPosition()
        {
            return this.Position;
        }

        public override void Update()
        {
        }
    }
}
